<?php
/**
 * Created by PhpStorm.
 * User: venki
 * Date: 2023/11/18
 * Time: 12:20
 */

namespace app\behaviors;

use app\Events\MyEvent;
use yii\base\Behavior;
use app\Events\CustomEvent;

class CustomBehavior extends Behavior
{
    public function events()
    {
        return [
            CustomEvent::class => 'handleCustomEvent',
        ];
    }

    public function handleCustomEvent(CustomEvent $event)
    {
        $data = $event->data;
        echo $data;die;
    }
}